<?php

$s = $_POST['s']??'';
//获取当前文件所在的绝对目录
$dir =  dirname(__FILE__)."/files".(($s)?('/'.$s):'');

$fileArr = $_POST['file_arr'];

$num = 0;
foreach($fileArr as $i=> $fileName){
    $fileName = str_replace('/','',$fileName);
    $res = unlink($dir.'/'.$fileName);
    $res && $num = $num + 1;
}


echo json_encode($num,JSON_UNESCAPED_UNICODE);